//
//@File    :	5.14_waiting.cpp
//@Time    :	2021/08/06 17:57:24
//@Auther  :	Sun Sheng
//@Contact :	970340843@qq.com
//@Desc    :	using clock() function,clock_t type. 延迟循环
//

#include <ctime>
#include <iostream>

using namespace std;
int main()
{
    cout<<"Enter the delay time,in seconds: ";
    float secs;
    cin>>secs;
    clock_t delay = secs * CLOCKS_PER_SEC;
    cout<<"starting\a\n";
    clock_t start = clock();
    while (clock() - start <delay)
    {
        
    }
    cout<<"done \a\n";
    system("pause");
    return 0;
}